package com.cndw.kongfu.model;

import java.util.ArrayList;
import java.util.List;

import javax.swing.table.AbstractTableModel;

import com.cndw.kongfu.config.Constants;

public class ChatDataTableModel extends AbstractTableModel{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3593688250629730166L;
	private List<ChatData> chatDataList = new ArrayList<ChatData>();
	
	public void addChatData(ChatData chatData) {
		chatDataList.add(chatData);
		fireTableDataChanged();
	}
	@Override
	public int getRowCount() {
		return chatDataList.size();
	}

	@Override
	public int getColumnCount() {
		return Constants.COLUMN_COUNT;
	}

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		return chatDataList.get(rowIndex);
	}

}
